import request from '@/utils/request'

export default{
  // 添加课程信息
  addCourseInfo(courseInfo){
    return request({
      url: '/eduservice/course/addCourseInfo',
      method: 'post',
      data:courseInfo
    })
  },
  // 根据id来删除课程信息
  deleteCourseById(courseId){
    return request({
      url: `/eduservice/course/${courseId}`,
      method: 'delete'
    })
  },
  // 查询所有课程信息
  getAllCourse(){
    return request({
      url: '/eduservice/course/getCourseList',
      method: 'get'
    })
  },
  // 课程查询分页
  getCoursePageList(current, limit, courseQuery){
    return request({
      url: `/eduservice/course/pageCourseCondition/${current}/${limit}`,
      method: 'post',
      data: courseQuery
    })
  },
  // 查询所有讲师
  getListTeacher(){
    return request({
      url: '/eduservice/teacher/findAll',
      method: 'get'
    })
  },
  // 根据课程id来查询课程信息
  getCourseInfoByCourseId(courseId){
    return request({
      url: `/eduservice/course/getCourseInfo/${courseId}`,
      method: 'get'
    })
  },
  // 根据课程id来更新课程数据
  updatedCourseInfo(courseInfo){
    return request({
      url: '/eduservice/course/updateCourseInfo',
      method: 'post',
      data: courseInfo
    })
  },
  // 根据课程id来查询确认课程信息
  getPulbishCourseInfo(courseId){
    return request({
      url: `/eduservice/course/getPublishCourseInfo/${courseId}`,
      method: 'get'
    })
  },
  // 发布课程
  publishCourse(courseId){
    return request({
      url: `/eduservice/course/publishCourse/${courseId}`,
      method: 'post'
    })
  }
}